//package com.ocom.human.service.impl;
//
//
//import com.baomidou.mybatisplus.core.conditions.Wrapper;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//import com.ocom.common.entity.human.EntityBizApply;
//import com.ocom.common.entity.human.EntityBizLeaveApply;
//import com.ocom.common.entity.master.EntityEcardRegCode;
//import com.ocom.common.enums.DataSourceEnum;
//import com.ocom.common.enums.MasterSlaveEnum;
//import com.ocom.common.request.company.GetApplyListByPidRequest;
//import com.ocom.human.dao.IDaoBizApply;
//import com.ocom.human.dao.IDaoEcardRegCode;
//import com.ocom.human.service.BizApplyService;
//import com.ocom.human.service.EcardRegCodeService;
//import com.ocom.mysql.aspect.DataSourceAspect;
//import org.springframework.stereotype.Service;
//
//import java.util.Date;
//import java.util.List;
//
//
//@Service
//public class BizApplyServiceImpl extends ServiceImpl<IDaoBizApply, EntityBizApply> implements BizApplyService {
//
//
//    @Override
//    @DataSourceAspect(type = DataSourceEnum.PART_DB,isMaster = MasterSlaveEnum.MASTER)
//    public boolean addApply(Long companyId, EntityBizApply entityBizApply) {
//        return this.save(entityBizApply);
//    }
//
//    @Override
//    @DataSourceAspect(type = DataSourceEnum.PART_DB,isMaster = MasterSlaveEnum.MASTER)
//    public boolean updateApply(Long companyId, EntityBizApply entityBizApply) {
//        UpdateWrapper<EntityBizApply> updateWrapper= new UpdateWrapper<>();
//        updateWrapper.eq("business_id",entityBizApply.getBusinessId());
//        if(null!=entityBizApply.getStatus()){
//            updateWrapper.set("status",entityBizApply.getStatus());
//        }
//        if(null!=entityBizApply.getActivitiKey()){
//            updateWrapper.set("activiti_key",entityBizApply.getActivitiKey());
//        }
//        return this.update(updateWrapper);
//    }
//
//    @Override
//    @DataSourceAspect(type = DataSourceEnum.PART_DB,isMaster = MasterSlaveEnum.MASTER)
//    public EntityBizApply getApplyOne(Long companyId, EntityBizApply entityBizLeaveApply) {
//        return  this.getOne(Wrappers.lambdaQuery(EntityBizApply.class).eq(EntityBizApply::getBusinessId,entityBizLeaveApply.getBusinessId()).last("limit 1"));
//    }
//
//    @Override
//    @DataSourceAspect(type = DataSourceEnum.PART_DB,isMaster = MasterSlaveEnum.MASTER)
//    public List<EntityBizApply> getApplyListByPid(Long companyId, EntityBizApply apply) {
//        return this.list(Wrappers.lambdaQuery(EntityBizApply.class)
//                .eq(EntityBizApply::getStatus,apply.getStatus())
//                .eq(EntityBizApply::getPId,apply.getPId())
//                .eq(EntityBizApply::getComId,apply.getComId()));
//    }
//
//    @Override
//    @DataSourceAspect(type = DataSourceEnum.PART_DB,isMaster = MasterSlaveEnum.MASTER)
//    public boolean update(Long companyId, EntityBizApply entityBizApply) {
//        return this.update(entityBizApply,Wrappers.lambdaQuery(EntityBizApply.class)
//                .eq(EntityBizApply::getComId,entityBizApply.getComId())
//                .eq(EntityBizApply::getBusinessId,entityBizApply.getBusinessId())
//        );
//    }
//}
